import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *     ClassPathXmlApplicationContext 在ClassPath中寻找 xml 配置文件
 *     FileSystemXmlApplicationContext  需要一个 xml 配置文件在系统中的路径
 *     AnnotationConfigApplicationContext  基于注解来使用
 */
public class SpringApp {
    public static void main(String[] args) {


        AbstractApplicationContext container = new ClassPathXmlApplicationContext("classpath:application.xml");
        /*try {
            Object provider = Class.forName("package.name.FXNewsProvider").newInstance();
            Object listener = Class.forName("package.name.DowJonesNewsListener").newInstance();
            Object persister = Class.forName("package.name.DowJonesNewsPersister").newInstance();
            BeanWrapper newsProvider = new BeanWrapperImpl(provider);
            newsProvider.setPropertyValue("newsListener", listener);
            newsProvider.setPropertyValue("newPersistener", persister);
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }*/


       /* Object nextDayDate = container.getBean("nextDayDate");
        System.out.println(nextDayDate instanceof DateTime);
        Object factoryBean = container.getBean("&nextDayDate");
        System.out.println(factoryBean instanceof DateTime);*/

       /* HelloWorld objA = (HelloWorld) context.getBean("helloWorld");
        objA.setMessage("I'm object A");
        objA.getMessage();
        HelloWorld objB = (HelloWorld) context.getBean("helloWorld");
        objB.getMessage();
        context.registerShutdownHook();*/
    }
}
